fix(docker): enable docker logs for pd/store/server containers#2980
fix(docker): enable docker logs for pd/store/server containers#2980bitflicker64 wants to merge 8 commits intoapache:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to make HugeGraph PD/Store/Server JVM logs visible via docker logs by stopping shell-level stdout/stderr redirection and ensuring Log4j2 emits to the console.
Changes:
- Removed
>> ... 2>&1redirections from startup scripts so Docker can capture stdout/stderr. - Added
consoleappender references to the Log4j2 root logger in dist configs. - Kept file appenders so non-Docker deployments still write log files.
Reviewed changes
Copilot reviewed 3 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| hugegraph-store/hg-store-dist/src/assembly/static/conf/log4j2.xml | Adds console appender to root logger. |
| hugegraph-store/hg-store-dist/src/assembly/static/bin/start-hugegraph-store.sh | Stops redirecting JVM output to a file. |
| hugegraph-server/hugegraph-dist/src/assembly/static/conf/log4j2.xml | Adds console appender to root logger (but see comment re AsyncLogger wiring). |
| hugegraph-server/hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh | Stops redirecting daemon/foreground output to a file (but see comment re foreground PID handling). |
| hugegraph-server/hugegraph-dist/src/assembly/static/bin/hugegraph-server.sh | Stops redirecting JVM output to a file. |
| hugegraph-pd/hg-pd-dist/src/assembly/static/conf/log4j2.xml | Adds console appender to root logger. |
| hugegraph-pd/hg-pd-dist/src/assembly/static/bin/start-hugegraph-pd.sh | Stops redirecting JVM output to a file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@imbajin I've wired the console appender into |
hugegraph-server/hugegraph-dist/src/assembly/static/bin/hugegraph-server.sh
Outdated
Show resolved
Hide resolved
Seems not necessary for now |
hugegraph-server/hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh
Show resolved
Hide resolved
|
@imbajin On it fixing both the additivity loggers and the shell redirect gate. Will push shortly. |
hugegraph-server/hugegraph-dist/src/assembly/static/bin/hugegraph-server.sh
Outdated
Show resolved
Hide resolved
|
STDOUT_MODE is currently only set via compose, so direct docker run won’t expose logs via docker logs |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 13 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 13 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Purpose of the PR
docker logsshows no application output for any HugeGraph container. All JVM logs are silently redirected to files inside the container, requiring manual exec + tail to debug. This PR fixes that.related comment - #2952 (comment)
Main Changes
Two root causes fixed:
>> ${OUTPUT} 2>&1before Docker could capture it — now gated behind aSTDOUT_MODE=trueenv var so bare metal installs are unaffectedlog4j2.xmlconfigs but never wired to the root logger andorg.apache.hugegraphAsyncLogger — added<appender-ref ref="console"/>to both in all 3 configsDocker compose files set
STDOUT_MODE=trueso containers stream logs viadocker logs. File appenders are kept so non-Docker deployments are unaffected.Also sets STDOUT_MODE=true as a default in Dockerfiles to ensure docker logs works for direct docker run usage, not just docker compose.
Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need